package com.sanyue.springboot.controller;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.sanyue.springboot.bean.Furn;
import com.sanyue.springboot.service.FurnService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 *
 * @author: Guan
 **/
@Controller
public class FurnController {
    @Resource
    private FurnService furnService;

    // 补充一点，时区问题 中国的东八区比SpringBoot默认区多了8h
    // GMT就是标准时间（格林尼治标准时间）
    // @JsonFormat(pattern = "yyyy-mm-dd HH:mm:ss, timezone = "GMT+8") 年月日 时分秒
    //         private Date birth;
    @ResponseBody
    @GetMapping("/furn")
    public Furn getFurnById(@RequestParam("id") Integer id){
        Furn furnById = furnService.getFurnById(id);
        return furnById;
    }


}
